// vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  server: {
    port: 5173
  },
  optimizeDeps: {
    include: ['cesium']
  },
  build: {
    rollupOptions: {
      output: {
        manualChunks: {
          cesium: ['cesium']
        }
      }
    }
  },
  // 添加 Cesium 静态资源处理
  define: {
    CESIUM_BASE_URL: JSON.stringify('/public/Cesium/')
  },
  // 复制 Cesium 静态资源
  publicDir: 'public'
})
